package com.vanysoft.business.data.controller;


import com.vanysoft.business.data.entity.CategoryLevel;
import com.vanysoft.business.data.service.CategoryLevelService;
import com.vanysoft.framework.utils.JSONResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 * 品类层级信息表 前端控制器
 * </p>
 *
 * @author YangLei
 * @since 2018-07-09
 */
@Controller
@RequestMapping("/data/categoryLevel")
public class CategoryLevelController {

    @Autowired
    CategoryLevelService categoryLevelService;

    /**
     * 获取所有层级
     *
     * @return
     */
    @ResponseBody
    @RequestMapping("all")
    public JSONResponse queryAll() {
        List<CategoryLevel> levelList = categoryLevelService.selectList(null);
        return new JSONResponse(levelList);
    }

}

